package com.tql.mall.boss.controller.manager;

import com.tql.mall.common.result.R;
import com.tql.mall.model.user.Adminstor;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

@Api(description = "平台管理系统的模拟登录接口")

@RestController
@RequestMapping("/boss/manager")
public class loginController {

    @ApiOperation(value = "登录（脚手架要求）")
    @PostMapping("/login")
    public R<HashMap<String, Object>> login(@RequestBody Adminstor adminstor){
        HashMap<String, Object> dataMap = new HashMap<>();
        dataMap.put("token","admin-token");
        return R.ok(dataMap);
    }

    @ApiOperation(value = "登录,返回用户信息（脚手架要求）")
    @GetMapping("/info")
    public R<HashMap<String, Object>> info(@RequestParam("token") String token){
        HashMap<String, Object> dataMap = new HashMap<>();
        dataMap.put("roles","[admin]");
        dataMap.put("introduction","I am a super administrator");
        dataMap.put("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        dataMap.put("name","Super Admin");
        return R.ok(dataMap);
    }



}
